package com.bsoft.gol.hcs.specialist.service.impl;

import ctd.spring.boot.annotation.SsdevService;
import ctd.util.annotation.RpcService;
import hcn.util.BaseResponse;
import com.bsoft.gol.hcs.his.service.IPatientHisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bsoft.gol.hcs.specialist.bean.request.PatientRequest;
import com.bsoft.gol.hcs.specialist.bean.response.HisPatient;
import com.bsoft.gol.hcs.specialist.bean.response.PatientResponse;
import com.bsoft.gol.hcs.specialist.service.IPatientService;
import com.bsoft.gol.hcs.utils.CommonUtils;

import java.util.List;

/**
 * @Description: 患者服务
 * @Author: zhaorb
 * @Date: 2020/7/20 14:35
 **/
@SsdevService("patient")
public class PatientServiceImpl implements IPatientService {
    private static final Logger log = LoggerFactory.getLogger(PatientServiceImpl.class);
    @Autowired
    private IPatientHisService patientHisService;


    @Override
    @RpcService
    @Deprecated
    public PatientResponse listPatient(PatientRequest request) {
        BaseResponse<PatientResponse> response = patientHisService.listPatient(request);
        if (CommonUtils.isNotEmpty(response.getData())) {
            List<HisPatient> patientList = response.getData().getPatientList();
            for (HisPatient patient : patientList) {
                String patientId = patient.getPatientId();
            }
            return null;
        } else {
            return response.getData();
        }
    }
}
